﻿// Genius
// Copyright (C) 2016 Dirk Friedenberger, www.frittenburger.de
//   
// This source file is subject to the Microsoft Public License (Ms-PL).
// http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using Genius.Brain.Shared.BO;
using Genius.SlackBot.Impl.Converter;
using Genius.SlackBot.Shared;
using Genius.SlackBot.Shared.Converter;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Genius.SlackBot.Impl.Locator
{
    public class Installer : IWindsorInstaller
    {
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(Component.For<ISlackBot>().ImplementedBy<SlackBot>().LifestyleSingleton());
            container.Register(Component.For<IConverter<JToken, IMessage>>().ImplementedBy<JsonToMessageConverter>().LifestyleSingleton());
            container.Register(Component.For<IConverter<JToken, IChannel>>().ImplementedBy<JsonToChannelConverter>().LifestyleSingleton());
            container.Register(Component.For<IConverter<JToken, IInstantMessaging>>().ImplementedBy<JsonToIMConverter>().LifestyleSingleton());
        }
    }
}
